<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>子元素选择器</title>
</head>
<style>
    div>p{
        color: chartreuse;
    }
    div>b{
        color: chocolate;
    }
    div>em{
        color: cornflowerblue;
    }
    em>p{
        color: darkred;
    }
</style>
<body>
    <div>
        <p>儿子级</p>
        <b>
            <p>孙子级</p>
        </b>
        <em>
            <b>
                <p>
                    重孙级
                </p>
            </b>
        </em>
        <em>
            <p>
                又一个
            </p>
        </em>

    </div>
</body>

</html>